<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
  <title></title>
  <style type="text/css">
    .error{
      color:red;
    }
  </style>
  <script src="../../static/assets/js/jquery.min.js"></script>
  <script type="application/javascript">
    function login(){
      var formData = {licensePlateNumber:$("#licensePlateNumber").val(),deviceType:$("#deviceType").val(),channelId:$("#channelId").val()};
      $.ajax({
        url:"/api/v1/code",
        type:"post",
        contentType:"application/json",
        data:JSON.stringify(formData),
        dataType:"jsonp"
      });
    }
  </script>
</head>
<body>
<form:form id="registryForm" method="POST" action="/code" commandName="loginDto">
  <table>
    <tr>
      <td>车牌号：</td>
      <td>
        <input type="text" id="licensePlateNumber" name="licensePlateNumber" value=""/>
        <form:errors path="licensePlateNumber" cssClass="error"/>
      </td>
    </tr>
    <tr>
      <td>机型：</td>
      <td><input type="text" id="deviceType" name="deviceType" value=""/></td>
    </tr>
    <tr>
      <td>channelId：</td>
      <td><input type="text" id="channelId" name="channelId" value=""/></td>
    </tr>
    <tr>
      <td colspan="2"><a href="javascript:void(0);" onclick="login();">登陆</a></td>
    </tr>
  </table>
</form:form>
</body>
</html>
